const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('db.db');

db.serialize(() => {
    /*db.run("CREATE TABLE lorem (info TEXT)");

    const stmt = db.prepare("INSERT INTO lorem VALUES (?)");
    for (let i = 0; i < 10; i++) {
        stmt.run("Ipsum " + i);
    }
    stmt.finalize();

    db.each("SELECT rowid AS id, info FROM lorem", (err, row) => {
        console.log(row.id + ": " + row.info);
    });*/
	
	db.run("INSERT INTO user (id,username) VALUES (101,'1111')");
	console.log(db.each("SELECT * FROM user WHERE id=100",function(err, data){
		console.log(data.id);
		if(data.id === 100){
			console.log(true);
		}
	}));
});

db.close();